package main

import (
	"fmt"
	"ai_util"
	"gopkg.in/alecthomas/kingpin.v2"
	"net/http"
	_ "net/http/pprof"
	"ai_crawler"
)

func main() {
	kingpin.Parse()

	go http.ListenAndServe(fmt.Sprintf(":%v", *PprofPort), nil)

	if err := ai_crawler.Init("conf/crawler.json"); err != nil {
		panic(err)
	}

	go ai_crawler.Run()

	ai_util.WaitSignalToStop()
}
